package com.qingke.java.test0831;

public class Commodity implements Cloneable {
	private String name;
	private double price;
	private int number;
	
	public Commodity(String name, double price, int number) {
		this.name = name;
		this.price = price > 0 ? price : 100;
		this.number = number > 0 ? number : 1;
	}
	
	public String getName() {
		return name;
	}
	
	public void setName(String name) {
		this.name = name;
	}
	
	public double getPrice() {
		return price;
	}
	
	public void setPrice(double price) {
		this.price = price > 0 ? price : 100;
	}

	public int getNumber() {
		return number;
	}

	public void setNumber(int number) {
		this.number = number > 0 ? number : 0;
	}
	
	public Object clone() throws CloneNotSupportedException {
		return super.clone();
	}
	
}
